Open
Conversation
Comment on lines
+81
to
+83
| const chain = chainType === 'solana' | ||
| ? context.getNodeParameter('signSubmitChainSolana', itemIndex) as string | ||
| : context.getNodeParameter('signSubmitChainEvm', itemIndex) as string; |
There was a problem hiding this comment.
Use chain type constant instead of string literal 'solana' for consistency and type safety
Suggested change
| const chain = chainType === 'solana' | |
| ? context.getNodeParameter('signSubmitChainSolana', itemIndex) as string | |
| : context.getNodeParameter('signSubmitChainEvm', itemIndex) as string; | |
| const chain = chainType === ChainFactory.getSupportedChainTypes()[0] // 'solana' | |
| ? context.getNodeParameter('signSubmitChainSolana', itemIndex) as string | |
| : context.getNodeParameter('signSubmitChainEvm', itemIndex) as string; |
Or better yet, consider creating a Chain enum/const object to use here instead of the magic string.
Context Used: Rule from dashboard - Use enum constants (e.g., Chain.SOLANA, Chain.BASE) instead of string literals when comparing chain ... (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: shared/actions/wallet/signTransaction.operation.ts
Line: 81:83
Comment:
Use chain type constant instead of string literal `'solana'` for consistency and type safety
```suggestion
const chain = chainType === ChainFactory.getSupportedChainTypes()[0] // 'solana'
? context.getNodeParameter('signSubmitChainSolana', itemIndex) as string
: context.getNodeParameter('signSubmitChainEvm', itemIndex) as string;
```
Or better yet, consider creating a Chain enum/const object to use here instead of the magic string.
**Context Used:** Rule from `dashboard` - Use enum constants (e.g., Chain.SOLANA, Chain.BASE) instead of string literals when comparing chain ... ([source](https://app.greptile.com/review/custom-context?memory=0e60096d-0843-4800-801b-f8a78b766fbc))
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Blockchain: Support EVM
Important Files Changed
Context used:
dashboard- Use enum constants (e.g., Chain.SOLANA, Chain.BASE) instead of string literals when comparing chain ... (source)